import request from "@/utils/request";
import ConstTable from "./ConstTable";

// 获取标签规则所有
export function getLabelRulesAllList(query) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBaseLabelRules/All`,
        method: "GET",
        data: query
    });
}

// 获取标签规则列表
export function getLabelRulesList(query) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBaseLabelRules`,
        method: "GET",
        data: query
    });
}

// 删除标签规则
export function delLabelRules(id) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBaseLabelRules/${id}`,
        method: "DELETE"
    });
}

// 批量删除标签规则
export function delLabelRulesBatch(data) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBaseLabelRules/BatchRemove`,
        method: "POST",
        data
    });
}

// 导出标签规则列表
export function exportLabelRules(query) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBaseLabelRules/Actions/Export`,
        method: "GET",
        data: query
    });
}

// 获取标签规则信息
export function getLabelRulesInfo(id) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBaseLabelRules/${id}`,
        method: "get"
    });
}

// 创建标签规则
export function createLabelRules(data) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBaseLabelRules`,
        method: "post",
        data: data
    });
}

// 更新标签规则
export function updateLabelRules(data) {
    return request({
        url: `${ConstTable.BaseUrl}/BaseData/ComBaseLabelRules/${data.id}`,
        method: "PUT",
        data: data
    });
}
